<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Admin extends CI_Controller {
    
	function __construct() 
	{
		parent::__construct();
                $this->load->model('dbase');
	}
        
        function index()
        {
            $permission = $this->dbase->check_admin();
            if ($permission <= 2 || $permission == null)
            {
                echo 'Fuck off.';
            } else {
                echo 'Welcome kind sir.';
                
            }
        }
        
        function admins($action = null, $info1 = null, $info2 = null)
        {
            if ($this->dbase->check_admin() <= 3)
            {
                echo 'Fuck off.';
            } else {
                if($action == 'update' && $info1 != null && $info2 != null)
                {
                    $this->dbase->update_admin($info1, $info2);
                }
                
                $page = array(
                    'content' => $this->load->view('admin/admins', '', TRUE),
                );
                
                $this->parser->parse('admin', $page);
            }
        }
        
        function news()
        {
            if ($this->dbase->check_admin() <= 2)
            {
                echo 'Fuck off.';
            } else {
                
                $page = array(
                    'content' => $this->load->view('admin/news', '', TRUE)
                );
                $this->parser->parse('admin', $page);
            }
        }
}

/* End of file admin.php */
/* Location: ./application/controllers/admin.php */
